// 引入 request 方法，假设 request 方法已经定义在某个工具文件中
import request from '/@/utils/request';
import { CodeGenConfig } from '../models';
// 定义 API 路径枚举
enum Api {
    SysCodeGenConfigDetail = '/sysCodeGenConfig/detail',
    SysCodeGenConfigList = '/sysCodeGenConfig/list',
    SysCodeGenConfigUpdate = '/sysCodeGenConfig/update',
}

// 定义 API 方法
/**
 * 获取代码生成配置详情 🔖
 * @param id 主键Id
 * @param codeGenId 代码生成主表ID
 * @param columnName 数据库字段名
 * @param columnKey 主外键
 * @param propertyName 实体属性名
 * @param columnLength 字段数据长度
 * @param lowerPropertyName 数据库字段名(首字母小写)
 * @param columnComment 字段描述
 * @param netType .NET类型
 * @param dataType 数据库中类型（物理类型）
 * @param nullableNetType 可空.NET类型
 * @param effectType 作用类型（字典）
 * @param fkConfigId 外键库标识
 * @param fkEntityName 外键实体名称
 * @param fkTableName 外键表名称
 * @param lowerFkEntityName 外键实体名称(首字母小写)
 * @param fkLinkColumnName 外键链接字段
 * @param fkDisplayColumns 外键显示字段
 * @param fkDisplayColumnList 外键显示字段
 * @param lowerFkDisplayColumnsList 外键显示字段(首字母小写)
 * @param fkColumnNetType 外键显示字段.NET类型
 * @param pidColumn 父级字段
 * @param dictTypeCode 字典code
 * @param queryType 查询方式
 * @param whetherQuery 是否是查询条件
 * @param whetherRetract 列表是否缩进（字典）
 * @param whetherRequired 是否必填（字典）
 * @param whetherSortable 是否可排序（字典）
 * @param whetherTable 列表显示
 * @param whetherAddUpdate 增改
 * @param whetherImport 导入
 * @param whetherCommon 是否是通用字段
 * @param orderNo 排序
 * @param isSelectorEffectType 是否是选择器控件
 * @param propertyNameTrimEndId 去掉尾部Id的属性名
 * @param lowerPropertyNameTrimEndId 去掉尾部Id的属性名
 * @param extendedPropertyName 扩展属性名称
 * @param lowerExtendedPropertyName 首字母小写的扩展属性名称
 */
export const apiSysCodeGenConfigDetailGet = (
    id?: number,
    codeGenId?: number,
    columnName?: string,
    columnKey?: string,
    propertyName?: string,
    columnLength?: number,
    lowerPropertyName?: string,
    columnComment?: string,
    netType?: string,
    dataType?: string,
    nullableNetType?: string,
    effectType?: string,
    fkConfigId?: string,
    fkEntityName?: string,
    fkTableName?: string,
    lowerFkEntityName?: string,
    fkLinkColumnName?: string,
    fkDisplayColumns?: string,
    fkDisplayColumnList?: string[],
    lowerFkDisplayColumnsList?: string[],
    fkColumnNetType?: string,
    pidColumn?: string,
    dictTypeCode?: string,
    queryType?: string,
    whetherQuery?: string,
    whetherRetract?: string,
    whetherRequired?: string,
    whetherSortable?: string,
    whetherTable?: string,
    whetherAddUpdate?: string,
    whetherImport?: string,
    whetherCommon?: string,
    orderNo?: number,
    isSelectorEffectType?: boolean,
    propertyNameTrimEndId?: string,
    lowerPropertyNameTrimEndId?: string,
    extendedPropertyName?: string,
    lowerExtendedPropertyName?: string
) =>
    request({
        url: Api.SysCodeGenConfigDetail,
        method: 'get',
        params: {
            Id: id,
            CodeGenId: codeGenId,
            ColumnName: columnName,
            ColumnKey: columnKey,
            PropertyName: propertyName,
            ColumnLength: columnLength,
            LowerPropertyName: lowerPropertyName,
            ColumnComment: columnComment,
            NetType: netType,
            DataType: dataType,
            NullableNetType: nullableNetType,
            EffectType: effectType,
            FkConfigId: fkConfigId,
            FkEntityName: fkEntityName,
            FkTableName: fkTableName,
            LowerFkEntityName: lowerFkEntityName,
            FkLinkColumnName: fkLinkColumnName,
            FkDisplayColumns: fkDisplayColumns,
            FkDisplayColumnList: fkDisplayColumnList,
            LowerFkDisplayColumnsList: lowerFkDisplayColumnsList,
            FkColumnNetType: fkColumnNetType,
            PidColumn: pidColumn,
            DictTypeCode: dictTypeCode,
            QueryType: queryType,
            WhetherQuery: whetherQuery,
            WhetherRetract: whetherRetract,
            WhetherRequired: whetherRequired,
            WhetherSortable: whetherSortable,
            WhetherTable: whetherTable,
            WhetherAddUpdate: whetherAddUpdate,
            WhetherImport: whetherImport,
            WhetherCommon: whetherCommon,
            OrderNo: orderNo,
            IsSelectorEffectType: isSelectorEffectType,
            PropertyNameTrimEndId: propertyNameTrimEndId,
            LowerPropertyNameTrimEndId: lowerPropertyNameTrimEndId,
            ExtendedPropertyName: extendedPropertyName,
            LowerExtendedPropertyName: lowerExtendedPropertyName,
        },
    });

/**
 * 获取代码生成配置列表 🔖
 * @param id 主键Id
 * @param codeGenId 代码生成主表ID
 * @param columnName 数据库字段名
 * @param columnKey 主外键
 * @param propertyName 实体属性名
 * @param columnLength 字段数据长度
 * @param lowerPropertyName 数据库字段名(首字母小写)
 * @param columnComment 字段描述
 * @param netType .NET类型
 * @param dataType 数据库中类型（物理类型）
 * @param nullableNetType 可空.NET类型
 * @param effectType 作用类型（字典）
 * @param fkConfigId 外键库标识
 * @param fkEntityName 外键实体名称
 * @param fkTableName 外键表名称
 * @param lowerFkEntityName 外键实体名称(首字母小写)
 * @param fkLinkColumnName 外键链接字段
 * @param fkDisplayColumns 外键显示字段
 * @param fkDisplayColumnList 外键显示字段
 * @param lowerFkDisplayColumnsList 外键显示字段(首字母小写)
 * @param fkColumnNetType 外键显示字段.NET类型
 * @param pidColumn 父级字段
 * @param dictTypeCode 字典code
 * @param queryType 查询方式
 * @param whetherQuery 是否是查询条件
 * @param whetherRetract 列表是否缩进（字典）
 * @param whetherRequired 是否必填（字典）
 * @param whetherSortable 是否可排序（字典）
 * @param whetherTable 列表显示
 * @param whetherAddUpdate 增改
 * @param whetherImport 导入
 * @param whetherCommon 是否是通用字段
 * @param orderNo 排序
 * @param isSelectorEffectType 是否是选择器控件
 * @param propertyNameTrimEndId 去掉尾部Id的属性名
 * @param lowerPropertyNameTrimEndId 去掉尾部Id的属性名
 * @param extendedPropertyName 扩展属性名称
 * @param lowerExtendedPropertyName 首字母小写的扩展属性名称
 */
export const apiSysCodeGenConfigListGet = (
    id?: number,
    codeGenId?: number,
    columnName?: string,
    columnKey?: string,
    propertyName?: string,
    columnLength?: number,
    lowerPropertyName?: string,
    columnComment?: string,
    netType?: string,
    dataType?: string,
    nullableNetType?: string,
    effectType?: string,
    fkConfigId?: string,
    fkEntityName?: string,
    fkTableName?: string,
    lowerFkEntityName?: string,
    fkLinkColumnName?: string,
    fkDisplayColumns?: string,
    fkDisplayColumnList?: string[],
    lowerFkDisplayColumnsList?: string[],
    fkColumnNetType?: string,
    pidColumn?: string,
    dictTypeCode?: string,
    queryType?: string,
    whetherQuery?: string,
    whetherRetract?: string,
    whetherRequired?: string,
    whetherSortable?: string,
    whetherTable?: string,
    whetherAddUpdate?: string,
    whetherImport?: string,
    whetherCommon?: string,
    orderNo?: number,
    isSelectorEffectType?: boolean,
    propertyNameTrimEndId?: string,
    lowerPropertyNameTrimEndId?: string,
    extendedPropertyName?: string,
    lowerExtendedPropertyName?: string
) =>
    request({
        url: Api.SysCodeGenConfigList,
        method: 'get',
        params: {
            Id: id,
            CodeGenId: codeGenId,
            ColumnName: columnName,
            ColumnKey: columnKey,
            PropertyName: propertyName,
            ColumnLength: columnLength,
            LowerPropertyName: lowerPropertyName,
            ColumnComment: columnComment,
            NetType: netType,
            DataType: dataType,
            NullableNetType: nullableNetType,
            EffectType: effectType,
            FkConfigId: fkConfigId,
            FkEntityName: fkEntityName,
            FkTableName: fkTableName,
            LowerFkEntityName: lowerFkEntityName,
            FkLinkColumnName: fkLinkColumnName,
            FkDisplayColumns: fkDisplayColumns,
            FkDisplayColumnList: fkDisplayColumnList,
            LowerFkDisplayColumnsList: lowerFkDisplayColumnsList,
            FkColumnNetType: fkColumnNetType,
            PidColumn: pidColumn,
            DictTypeCode: dictTypeCode,
            QueryType: queryType,
            WhetherQuery: whetherQuery,
            WhetherRetract: whetherRetract,
            WhetherRequired: whetherRequired,
            WhetherSortable: whetherSortable,
            WhetherTable: whetherTable,
            WhetherAddUpdate: whetherAddUpdate,
            WhetherImport: whetherImport,
            WhetherCommon: whetherCommon,
            OrderNo: orderNo,
            IsSelectorEffectType: isSelectorEffectType,
            PropertyNameTrimEndId: propertyNameTrimEndId,
            LowerPropertyNameTrimEndId: lowerPropertyNameTrimEndId,
            ExtendedPropertyName: extendedPropertyName,
            LowerExtendedPropertyName: lowerExtendedPropertyName,
        },
    });

/**
 * 更新代码生成配置 🔖
 * @param body 请求体
 */
export const apiSysCodeGenConfigUpdatePost = (body?: CodeGenConfig[]) =>
    request({
        url: Api.SysCodeGenConfigUpdate,
        method: 'post',
        data: body,
    });